<?php

namespace app\zbj\controller;

use think\Controller;
use think\Db;
use think\Request;

class User extends Base
{
    // 用户列表页面
    public function index(Request $request)
    {

        $get=myarr($request->get());
        $get['p']=isset($get['p'])?$get['p']:config('paginate.list_rows');

        $list=Db::name('users')
            ->alias('a')
            ->join('lc_vip b','a.vid=b.id')
            ->join('lc_agents c','a.aid=c.id')
            ->field('a.id,a.name,a.phonenumber,a.balance,a.creationtime,a.assetaccount,a.RNA,a.statesinfo,b.name vname,c.name aname')
            ->where('refereecode',0)
            ->paginate($get['p'],false,['query'=>$get]);


        $page=$list->render();
        $list=$list->items();
        return view('users/index',['list'=>$list,'page'=>$page,'get'=>$get]);
    }



}